package com.lindroy.jetpacknotes.navigation.navigationui

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import com.lindroy.jetpacknotes.R
import kotlinx.android.synthetic.main.activity_navigation_uibottom_view.*

class NavigationUIBottomViewActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_navigation_uibottom_view)

        val navController = findNavController(R.id.nav_host_fragment_ui_bottom)
        //传入id的页面不会显示返回箭头
        val appBarConfiguration =
            AppBarConfiguration(setOf(R.id.homeFragment, R.id.mineFragment, R.id.settingsFragment))
        setupActionBarWithNavController(navController, appBarConfiguration)
        bottomNav.setupWithNavController(navController)
    }
}